﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_QT_ZICHOUZJJS实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_QT_ZICHOUZJJS
    {
        private decimal? m_dec_i_gongchengsl;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_m;

        private decimal? m_dec_i_rijiesl;

        private decimal? m_dec_i_xiangmulx;

        private decimal? m_dec_i_y;

        private decimal? m_dec_i_ywy;

        private decimal m_dec_id;

        private decimal? m_dec_n_jine;

        private DateTime? m_DT_d_caozuosj;

        private DateTime? m_DT_d_riqi;

        private DateTime? m_DT_d_wangongrq;

        private DateTime? m_DT_d_xiugairq;

        private string m_str_s_beiyong1;

        private string m_str_s_beiyong2;

        private string m_str_s_caozuor;

        private string m_str_s_danwei;

        private string m_str_s_guanlikh;

        private string m_str_s_juhao;

        private string m_str_s_juming;

        private string m_str_s_miaoshu;

        private string m_str_s_quming;

        private string m_str_s_shurubm;

        private string m_str_s_tongjiym;

        private string m_str_s_wangongrq;

        private string m_str_s_xiangmulx;

        private string m_str_s_xiugair;

        private string m_str_s_yonghuh;

        private string m_str_s_yonghum;

        private string m_str_s_zhandianbh;

        /// <summary>
        ///     主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     站点号
        /// </summary>
        public string S_ZHANDIANBH
        {
            get { return m_str_s_zhandianbh; }
            set { m_str_s_zhandianbh = value; }
        }

        /// <summary>
        ///     用户号
        /// </summary>
        public string S_YONGHUH
        {
            get { return m_str_s_yonghuh; }
            set { m_str_s_yonghuh = value; }
        }

        /// <summary>
        ///     水量年
        /// </summary>
        public decimal? I_Y
        {
            get { return m_dec_i_y; }
            set { m_dec_i_y = value; }
        }

        /// <summary>
        ///     水量月
        /// </summary>
        public decimal? I_M
        {
            get { return m_dec_i_m; }
            set { m_dec_i_m = value; }
        }

        /// <summary>
        ///     输入部门
        /// </summary>
        public string S_SHURUBM
        {
            get { return m_str_s_shurubm; }
            set { m_str_s_shurubm = value; }
        }

        /// <summary>
        ///     日期
        /// </summary>
        public DateTime? D_RIQI
        {
            get { return m_DT_d_riqi; }
            set { m_DT_d_riqi = value; }
        }

        /// <summary>
        ///     完工日期
        /// </summary>
        public DateTime? D_WANGONGRQ
        {
            get { return m_DT_d_wangongrq; }
            set { m_DT_d_wangongrq = value; }
        }

        /// <summary>
        ///     项目类型
        /// </summary>
        public decimal? I_XIANGMULX
        {
            get { return m_dec_i_xiangmulx; }
            set { m_dec_i_xiangmulx = value; }
        }

        /// <summary>
        ///     工程数量
        /// </summary>
        public decimal? I_GONGCHENGSL
        {
            get { return m_dec_i_gongchengsl; }
            set { m_dec_i_gongchengsl = value; }
        }

        /// <summary>
        ///     描述
        /// </summary>
        public string S_MIAOSHU
        {
            get { return m_str_s_miaoshu; }
            set { m_str_s_miaoshu = value; }
        }

        /// <summary>
        ///     日节水量
        /// </summary>
        public decimal? I_RIJIESL
        {
            get { return m_dec_i_rijiesl; }
            set { m_dec_i_rijiesl = value; }
        }

        /// <summary>
        ///     金额
        /// </summary>
        public decimal? N_JINE
        {
            get { return m_dec_n_jine; }
            set { m_dec_n_jine = value; }
        }

        /// <summary>
        ///     0:正常 -1:删除
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     修改人
        /// </summary>
        public string S_XIUGAIR
        {
            get { return m_str_s_xiugair; }
            set { m_str_s_xiugair = value; }
        }

        /// <summary>
        ///     修改日期
        /// </summary>
        public DateTime? D_XIUGAIRQ
        {
            get { return m_DT_d_xiugairq; }
            set { m_DT_d_xiugairq = value; }
        }

        /// <summary>
        ///     备用1
        /// </summary>
        public string S_BEIYONG1
        {
            get { return m_str_s_beiyong1; }
            set { m_str_s_beiyong1 = value; }
        }

        /// <summary>
        ///     完工日期
        /// </summary>
        public string S_WANGONGRQ
        {
            get { return m_str_s_wangongrq; }
            set { m_str_s_wangongrq = value; }
        }

        /// <summary>
        ///     用户名
        /// </summary>
        public string S_YONGHUM
        {
            get { return m_str_s_yonghum; }
            set { m_str_s_yonghum = value; }
        }

        /// <summary>
        ///     业务员
        /// </summary>
        public decimal? I_YWY
        {
            get { return m_dec_i_ywy; }
            set { m_dec_i_ywy = value; }
        }

        /// <summary>
        ///     项目类型
        /// </summary>
        public string S_XIANGMULX
        {
            get { return m_str_s_xiangmulx; }
            set { m_str_s_xiangmulx = value; }
        }

        /// <summary>
        ///     管理块号
        /// </summary>
        public string S_GUANLIKH
        {
            get { return m_str_s_guanlikh; }
            set { m_str_s_guanlikh = value; }
        }

        /// <summary>
        ///     单位
        /// </summary>
        public string S_DANWEI
        {
            get { return m_str_s_danwei; }
            set { m_str_s_danwei = value; }
        }

        /// <summary>
        ///     局名
        /// </summary>
        public string S_JUMING
        {
            get { return m_str_s_juming; }
            set { m_str_s_juming = value; }
        }

        /// <summary>
        ///     局号
        /// </summary>
        public string S_JUHAO
        {
            get { return m_str_s_juhao; }
            set { m_str_s_juhao = value; }
        }

        /// <summary>
        ///     统计年月
        /// </summary>
        public string S_TONGJIYM
        {
            get { return m_str_s_tongjiym; }
            set { m_str_s_tongjiym = value; }
        }

        /// <summary>
        ///     区名
        /// </summary>
        public string S_QUMING
        {
            get { return m_str_s_quming; }
            set { m_str_s_quming = value; }
        }

        /// <summary>
        ///     备用2
        /// </summary>
        public string S_BEIYONG2
        {
            get { return m_str_s_beiyong2; }
            set { m_str_s_beiyong2 = value; }
        }

        /// <summary>
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        /// </summary>
        public DateTime? D_CAOZUOSJ
        {
            get { return m_DT_d_caozuosj; }
            set { m_DT_d_caozuosj = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_QT_ZICHOUZJJSProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_QT_ZICHOUZJJSProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_QT_ZICHOUZJJS实体添加或者修改YS_QT_ZICHOUZJJS信息
        /// </summary>
        public bool InsertOrUpdate(YS_QT_ZICHOUZJJS YS_QT_ZICHOUZJJS, OracleTransaction Transaction)
        {
            if (YS_QT_ZICHOUZJJS.ID == 0)
                InsertYS_QT_ZICHOUZJJ(YS_QT_ZICHOUZJJS, Transaction);
            else
                UpdateYS_QT_ZICHOUZJJ(YS_QT_ZICHOUZJJS, Transaction);
            return YS_QT_ZICHOUZJJS.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_QT_ZICHOUZJJS实体添加或修改YS_QT_ZICHOUZJJS信息
        /// </summary>
        public bool InsertOrUpdate(YS_QT_ZICHOUZJJS YS_QT_ZICHOUZJJS)
        {
            return InsertOrUpdate(YS_QT_ZICHOUZJJS, null);
        }


        /// <summary>
        ///     根据YS_QT_ZICHOUZJJS主键删除YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_QT_ZICHOUZJJ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_QT_ZICHOUZJJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_QT_ZICHOUZJJS主键删除YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_QT_ZICHOUZJJ(decimal ID)
        {
            return DeleteYS_QT_ZICHOUZJJ(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_QT_ZICHOUZJJsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_QT_ZICHOUZJJsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_QT_ZICHOUZJJsDynamic(string WhereClause)
        {
            return DeleteYS_QT_ZICHOUZJJsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_QT_ZICHOUZJJS主键选择YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_ZICHOUZJJS信息</returns>
        public YS_QT_ZICHOUZJJS SelectYS_QT_ZICHOUZJJ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_ZICHOUZJJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_QT_ZICHOUZJJS = PopulateYS_QT_ZICHOUZJJS(rd);
                rd.Close();
                return YS_QT_ZICHOUZJJS;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_QT_ZICHOUZJJS主键选择YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <returns>YS_QT_ZICHOUZJJS信息</returns>
        public YS_QT_ZICHOUZJJS SelectYS_QT_ZICHOUZJJ(decimal ID)
        {
            return SelectYS_QT_ZICHOUZJJ(ID, null);
        }

        /// <summary>
        ///     选择所有YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_QT_ZICHOUZJJS信息</returns>
        public DataTable SelectYS_QT_ZICHOUZJJsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_ZICHOUZJJsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <returns>所有YS_QT_ZICHOUZJJS信息</returns>
        public DataTable SelectYS_QT_ZICHOUZJJsAll()
        {
            return SelectYS_QT_ZICHOUZJJsAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_ZICHOUZJJS信息</returns>
        public DataTable SelectYS_QT_ZICHOUZJJsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_ZICHOUZJJsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_QT_ZICHOUZJJS信息</returns>
        public DataTable SelectYS_QT_ZICHOUZJJsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_QT_ZICHOUZJJsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_ZICHOUZJJS信息</returns>
        public DataTable SelectYS_QT_ZICHOUZJJsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_ZICHOUZJJsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_QT_ZICHOUZJJS信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_QT_ZICHOUZJJS信息</returns>
        public DataTable SelectYS_QT_ZICHOUZJJsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_QT_ZICHOUZJJsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_QT_ZICHOUZJJS字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_QT_ZICHOUZJJsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_QT_ZICHOUZJJDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_QT_ZICHOUZJJS字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_QT_ZICHOUZJJsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_QT_ZICHOUZJJsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_QT_ZICHOUZJJ(YS_QT_ZICHOUZJJS YS_QT_ZICHOUZJJS, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_QT_ZICHOUZJJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_QT_ZICHOUZJJS.S_ZHANDIANBH;
            storedParams[1].Value = YS_QT_ZICHOUZJJS.S_YONGHUH;
            storedParams[2].Value = YS_QT_ZICHOUZJJS.I_Y;
            storedParams[3].Value = YS_QT_ZICHOUZJJS.I_M;
            storedParams[4].Value = YS_QT_ZICHOUZJJS.S_SHURUBM;
            storedParams[5].Value = YS_QT_ZICHOUZJJS.D_RIQI;
            storedParams[6].Value = YS_QT_ZICHOUZJJS.D_WANGONGRQ;
            storedParams[7].Value = YS_QT_ZICHOUZJJS.I_XIANGMULX;
            storedParams[8].Value = YS_QT_ZICHOUZJJS.I_GONGCHENGSL;
            storedParams[9].Value = YS_QT_ZICHOUZJJS.S_MIAOSHU;
            storedParams[10].Value = YS_QT_ZICHOUZJJS.I_RIJIESL;
            storedParams[11].Value = YS_QT_ZICHOUZJJS.N_JINE;
            storedParams[12].Value = YS_QT_ZICHOUZJJS.I_JLZT;
            storedParams[13].Value = YS_QT_ZICHOUZJJS.S_XIUGAIR;
            storedParams[14].Value = YS_QT_ZICHOUZJJS.D_XIUGAIRQ;
            storedParams[15].Value = YS_QT_ZICHOUZJJS.S_BEIYONG1;
            storedParams[16].Value = YS_QT_ZICHOUZJJS.S_WANGONGRQ;
            storedParams[17].Value = YS_QT_ZICHOUZJJS.S_YONGHUM;
            storedParams[18].Value = YS_QT_ZICHOUZJJS.I_YWY;
            storedParams[19].Value = YS_QT_ZICHOUZJJS.S_XIANGMULX;
            storedParams[20].Value = YS_QT_ZICHOUZJJS.S_GUANLIKH;
            storedParams[21].Value = YS_QT_ZICHOUZJJS.S_DANWEI;
            storedParams[22].Value = YS_QT_ZICHOUZJJS.S_JUMING;
            storedParams[23].Value = YS_QT_ZICHOUZJJS.S_JUHAO;
            storedParams[24].Value = YS_QT_ZICHOUZJJS.S_TONGJIYM;
            storedParams[25].Value = YS_QT_ZICHOUZJJS.S_QUMING;
            storedParams[26].Value = YS_QT_ZICHOUZJJS.S_BEIYONG2;
            storedParams[27].Value = YS_QT_ZICHOUZJJS.S_CAOZUOR;
            storedParams[28].Value = YS_QT_ZICHOUZJJS.D_CAOZUOSJ;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_QT_ZICHOUZJJS.ID = Convert.ToInt32(storedParams[29].Value);
            return result;
        }

        private bool UpdateYS_QT_ZICHOUZJJ(YS_QT_ZICHOUZJJS YS_QT_ZICHOUZJJS, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_QT_ZICHOUZJJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_QT_ZICHOUZJJS.S_ZHANDIANBH;
            storedParams[1].Value = YS_QT_ZICHOUZJJS.S_YONGHUH;
            storedParams[2].Value = YS_QT_ZICHOUZJJS.I_Y;
            storedParams[3].Value = YS_QT_ZICHOUZJJS.I_M;
            storedParams[4].Value = YS_QT_ZICHOUZJJS.S_SHURUBM;
            storedParams[5].Value = YS_QT_ZICHOUZJJS.D_RIQI;
            storedParams[6].Value = YS_QT_ZICHOUZJJS.D_WANGONGRQ;
            storedParams[7].Value = YS_QT_ZICHOUZJJS.I_XIANGMULX;
            storedParams[8].Value = YS_QT_ZICHOUZJJS.I_GONGCHENGSL;
            storedParams[9].Value = YS_QT_ZICHOUZJJS.S_MIAOSHU;
            storedParams[10].Value = YS_QT_ZICHOUZJJS.I_RIJIESL;
            storedParams[11].Value = YS_QT_ZICHOUZJJS.N_JINE;
            storedParams[12].Value = YS_QT_ZICHOUZJJS.I_JLZT;
            storedParams[13].Value = YS_QT_ZICHOUZJJS.S_XIUGAIR;
            storedParams[14].Value = YS_QT_ZICHOUZJJS.D_XIUGAIRQ;
            storedParams[15].Value = YS_QT_ZICHOUZJJS.S_BEIYONG1;
            storedParams[16].Value = YS_QT_ZICHOUZJJS.S_WANGONGRQ;
            storedParams[17].Value = YS_QT_ZICHOUZJJS.S_YONGHUM;
            storedParams[18].Value = YS_QT_ZICHOUZJJS.I_YWY;
            storedParams[19].Value = YS_QT_ZICHOUZJJS.S_XIANGMULX;
            storedParams[20].Value = YS_QT_ZICHOUZJJS.S_GUANLIKH;
            storedParams[21].Value = YS_QT_ZICHOUZJJS.S_DANWEI;
            storedParams[22].Value = YS_QT_ZICHOUZJJS.S_JUMING;
            storedParams[23].Value = YS_QT_ZICHOUZJJS.S_JUHAO;
            storedParams[24].Value = YS_QT_ZICHOUZJJS.S_TONGJIYM;
            storedParams[25].Value = YS_QT_ZICHOUZJJS.S_QUMING;
            storedParams[26].Value = YS_QT_ZICHOUZJJS.S_BEIYONG2;
            storedParams[27].Value = YS_QT_ZICHOUZJJS.S_CAOZUOR;
            storedParams[28].Value = YS_QT_ZICHOUZJJS.D_CAOZUOSJ;
            storedParams[29].Value = YS_QT_ZICHOUZJJS.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_QT_ZICHOUZJJS PopulateYS_QT_ZICHOUZJJS(IDataReader dr)
        {
            var YS_QT_ZICHOUZJJS = new YS_QT_ZICHOUZJJS();
            YS_QT_ZICHOUZJJS.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_QT_ZICHOUZJJS.S_ZHANDIANBH = dr["S_ZHANDIANBH"] == DBNull.Value ? null : (string) dr["S_ZHANDIANBH"];
            YS_QT_ZICHOUZJJS.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? null : (string) dr["S_YONGHUH"];
            YS_QT_ZICHOUZJJS.I_Y = dr["I_Y"] == DBNull.Value ? null : (decimal?) dr["I_Y"];
            YS_QT_ZICHOUZJJS.I_M = dr["I_M"] == DBNull.Value ? null : (decimal?) dr["I_M"];
            YS_QT_ZICHOUZJJS.S_SHURUBM = dr["S_SHURUBM"] == DBNull.Value ? null : (string) dr["S_SHURUBM"];
            YS_QT_ZICHOUZJJS.D_RIQI = dr["D_RIQI"] == DBNull.Value ? null : (DateTime?) dr["D_RIQI"];
            YS_QT_ZICHOUZJJS.D_WANGONGRQ = dr["D_WANGONGRQ"] == DBNull.Value ? null : (DateTime?) dr["D_WANGONGRQ"];
            YS_QT_ZICHOUZJJS.I_XIANGMULX = dr["I_XIANGMULX"] == DBNull.Value ? null : (decimal?) dr["I_XIANGMULX"];
            YS_QT_ZICHOUZJJS.I_GONGCHENGSL =
                dr["I_GONGCHENGSL"] == DBNull.Value ? null : (decimal?) dr["I_GONGCHENGSL"];
            YS_QT_ZICHOUZJJS.S_MIAOSHU = dr["S_MIAOSHU"] == DBNull.Value ? null : (string) dr["S_MIAOSHU"];
            YS_QT_ZICHOUZJJS.I_RIJIESL = dr["I_RIJIESL"] == DBNull.Value ? null : (decimal?) dr["I_RIJIESL"];
            YS_QT_ZICHOUZJJS.N_JINE = dr["N_JINE"] == DBNull.Value ? null : (decimal?) dr["N_JINE"];
            YS_QT_ZICHOUZJJS.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            YS_QT_ZICHOUZJJS.S_XIUGAIR = dr["S_XIUGAIR"] == DBNull.Value ? null : (string) dr["S_XIUGAIR"];
            YS_QT_ZICHOUZJJS.D_XIUGAIRQ = dr["D_XIUGAIRQ"] == DBNull.Value ? null : (DateTime?) dr["D_XIUGAIRQ"];
            YS_QT_ZICHOUZJJS.S_BEIYONG1 = dr["S_BEIYONG1"] == DBNull.Value ? null : (string) dr["S_BEIYONG1"];
            YS_QT_ZICHOUZJJS.S_WANGONGRQ = dr["S_WANGONGRQ"] == DBNull.Value ? null : (string) dr["S_WANGONGRQ"];
            YS_QT_ZICHOUZJJS.S_YONGHUM = dr["S_YONGHUM"] == DBNull.Value ? null : (string) dr["S_YONGHUM"];
            YS_QT_ZICHOUZJJS.I_YWY = dr["I_YWY"] == DBNull.Value ? null : (decimal?) dr["I_YWY"];
            YS_QT_ZICHOUZJJS.S_XIANGMULX = dr["S_XIANGMULX"] == DBNull.Value ? null : (string) dr["S_XIANGMULX"];
            YS_QT_ZICHOUZJJS.S_GUANLIKH = dr["S_GUANLIKH"] == DBNull.Value ? null : (string) dr["S_GUANLIKH"];
            YS_QT_ZICHOUZJJS.S_DANWEI = dr["S_DANWEI"] == DBNull.Value ? null : (string) dr["S_DANWEI"];
            YS_QT_ZICHOUZJJS.S_JUMING = dr["S_JUMING"] == DBNull.Value ? null : (string) dr["S_JUMING"];
            YS_QT_ZICHOUZJJS.S_JUHAO = dr["S_JUHAO"] == DBNull.Value ? null : (string) dr["S_JUHAO"];
            YS_QT_ZICHOUZJJS.S_TONGJIYM = dr["S_TONGJIYM"] == DBNull.Value ? null : (string) dr["S_TONGJIYM"];
            YS_QT_ZICHOUZJJS.S_QUMING = dr["S_QUMING"] == DBNull.Value ? null : (string) dr["S_QUMING"];
            YS_QT_ZICHOUZJJS.S_BEIYONG2 = dr["S_BEIYONG2"] == DBNull.Value ? null : (string) dr["S_BEIYONG2"];
            YS_QT_ZICHOUZJJS.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            YS_QT_ZICHOUZJJS.D_CAOZUOSJ = dr["D_CAOZUOSJ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUOSJ"];
            return YS_QT_ZICHOUZJJS;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion